﻿@model Entities.FilterOperations

<script type="text/javascript">


    $(document).ready(function () {
        $('.date').datepicker({
            dateFormat: "mm/dd/yy",
            maxDate: '0'
        });

    });

    function ClearControls() {
        var elements = document.getElementsByTagName("input");
        for (var ii = 0; ii < elements.length; ii++) {
            if (elements[ii].type == "text") {
                elements[ii].value = "";
            }
        }
    }
    
</script>
<table>
    <tr>
        <td>
            Start Date
        </td>
        <td>@Html.TextBoxFor(m => m.StartDate, new { @class = "date", placeholder = @WebUI.Resources.Beginningoftime })
            @Html.ValidationMessageFor(v => v.StartDate)
        </td>
        <td>
            End Date
        </td>
        <td>@Html.TextBoxFor(m => m.EndDate, new { @class = "date", placeholder = @WebUI.Resources.Today })
            @Html.ValidationMessageFor(v => v.EndDate)
        </td>
    </tr>
    <tr>
        <td>
            User
        </td>
        <td>@Html.TextBoxFor(m => m.User)
        </td>
        @if (Model.RenderFileType)
        {
          
            <td>
                File Type
            </td>
            <td>@Html.ArrayToTextFor(m => m.FileTypes, new { @readonly = "readonly" })
            </td>
          
        }
    </tr>
    <tr>
        @if (Model.RenderFileName)
        {
      
            <td>
                File Name
            </td>
            <td>@Html.TextBoxFor(m => m.FileName)
            </td>
      
        }
        <td>
            Host
        </td>
        <td>
            @Html.ArrayToTextFor(m => m.Hosts, new { @readonly = "readonly" })
        </td>
    </tr>
    <tr>
        <td>
            Policies
        </td>
        <td>
            @Html.ArrayToTextFor(m => m.Policies, new { @readonly = "readonly" })
        </td>
    </tr>
    @if (Model.RenderOperationTypes)
    {
        <tr>
            <td>
                Operation Types
            </td>
            <td>
                @Html.ArrayToTextFor(m => m.OperationTypes, new { @readonly = "readonly" })
            </td>
        </tr>
    }
</table>
@Html.HiddenFor(o => o.operationType)
@Html.HiddenFor(o => o.IsDir)
@Html.HiddenFor(o => o.BotName)
<input type="submit" value='@WebUI.Resources.Search' />
<input id="Button1" type="button" value="Clear" onclick='ClearControls()' />
